package org.jeecg.modules.workservice.controller;

/**
 * 类名称：WorkOrderUserController
 * 类描述：TODO
 * 创建人：zwr
 * 创建时间：2021-08-28   12:25
 */

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.workservice.entity.WorkOrderUser;
import org.jeecg.modules.workservice.entity.WorkService;
import org.jeecg.modules.workservice.service.IWorkOrderUserService;
import org.jeecg.modules.workservice.service.IWorkServiceService;
import org.jeecg.modules.workservice.vo.WorkOrderUserVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Description: 工单人员表
 * @Author: jeecg-boot
 * @Date:   2021-08-25
 * @Version: V1.0
 */
@Api(tags="工单人员表")
@RestController
@RequestMapping("/workservice/workOrderUser")
@Slf4j
public class WorkOrderUserController extends JeecgController<WorkOrderUser, IWorkOrderUserService> {

    @Resource
    private IWorkOrderUserService iWorkOrderUserService;

    @AutoLog(value = "工单人员表-分配工单查询人员信息")
    @ApiOperation(value="工单人员表-分配工单查询人员信息", notes="工单人员表-分配工单查询人员信息")
    @GetMapping(value = "/findWorkOrderUserVo")
    public Result<WorkOrderUserVo> findWorkOrderUserVo(@RequestParam(name="workOrderId")String workOrderId){
        Result<WorkOrderUserVo> result=new Result<>();
        result.setResult(iWorkOrderUserService.findWorkOrderUserVo(workOrderId));
        return  result;
    }



    @AutoLog(value = "工单人员表-修改人员为负责人")
    @ApiOperation(value="工单人员表-修改人员为负责人", notes="工单人员表-修改人员为负责人")
    @PutMapping(value = "/updWorkOrderUser")
    public Result<?> updWorkOrderUser(String workOrderId,String orderUserId) {
        iWorkOrderUserService.updWorkOrderUser(workOrderId, orderUserId);
        return Result.OK("更改成功!");
    }


}
